﻿<!DOCTYPE html>
<html>
<head>
    <script src="/js/header.js"></script>
    <style type="text/css">
        .margin-font {
            margin-top: 7px;
            font-weight: bold;
        }
        .no-color {
            background-color: white !important;
        }
        </style>
</head>
<body style="background-color: white;">
    <section class="container-fluid" >
        <ul class="nav nav-tabs m15_t" id="myTab">
            <li class="active"><a href="#home" data-toggle="tab">银行卡基本信息</a></li>
            <!--<li class="limit"><a href="#ext" data-toggle="tab">额外限制</a></li>
            <li class="transportCard"><a href="#transportCard" data-toggle="tab">中转设定</a></li>-->
        </ul>

        <form class="form-horizontal m15_t" id="form" onsubmit="return false;">
            <div class="row m15_t" id="header">
                <a href="#head"></a>
                <div class="tab-content col-md-3">
                    <input type="hidden" name="bcid" value="0">

                    <div class="tab-pane fade in active" id="home">
                        <div class="form-group">
                            <label class="wd125 control-label">银行卡类型：</label>
                            <label class="wd125 control-label margin-font" id="cardType"></label>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">付款类型：</label>
                            <label class="wd125 control-label margin-font" id="paymentTypeName"></label>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">银行名称：</label>
                            <label class="wd125 control-label margin-font" id="bankName"></label>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label"> 订单号：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="orderNo"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label"> 银行卡号：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="cardNumber"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">银行副卡号：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="secCardNumber"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label"> 银行卡使用状态：</label>
                            <label class="wd125 control-label margin-font" id="usingStatus"></label>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label"> 银行卡启用状态：</label>
                            <label class="wd125 control-label margin-font" id="enableStatus"></label>
                        </div>

                        <div class="form-group">
                            <label class="wd125 control-label">登陆名称：</label>
                            <label class="wd125 control-label margin-font" id="loginName"></label>
                        </div>

                        <div class="form-group">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>登陆密码：</label>
                            <div class="input-group wd250">
                                <input class="form-control" type="password" id="passwordLogin" name="passwordLogin" maxlength="40" readonly autocomplete="off">
                                <span class="input-group-addon" onclick="changeInputType(this);">
                                    <i class="glyphicon glyphicon-eye-close"></i>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">查询密码：</label>
                            <div class="input-group wd250">
                                <input class="form-control" type="password" id="passwordQuery" name="passwordQuery" maxlength="40" readonly autocomplete="off">
                                <span class="input-group-addon" onclick="changeInputType(this);">
                                    <i class="glyphicon glyphicon-eye-close"></i>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">支付密码：</label>
                            <div class="input-group wd250">
                                <input class="form-control" type="password" id="passwordPay" name="passwordPay" maxlength="6" readonly autocomplete="off">
                                <span class="input-group-addon" onclick="changeInputType(this);">
                                    <i class="glyphicon glyphicon-eye-close"></i>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">网盾密码：</label>
                            <div class="input-group wd250">
                                <input class="form-control" type="password" id="passwordShield" name="passwordShield" maxlength="40" readonly autocomplete="off">
                                <span class="input-group-addon" onclick="changeInputType(this);">
                                    <i class="glyphicon glyphicon-eye-close"></i>
                                </span>
                            </div>
                        </div>

                        <!--付款卡-->
                        <div class="form-group paymentStart" id="divPaymentStart">
                            <label class="wd125 control-label">付款区间起：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="paymentStart"></label>
                            </div>
                        </div>
                        <div class="form-group paymentEnd" id="divPaymentEnd">
                            <label class="wd125 control-label">付款区间迄：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="paymentEnd"></label>
                            </div>
                        </div>
                        <div class="form-group payFeeRatio" id="divPayFeeRatio">
                            <label class="wd125 control-label">付款费率(%)：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="payFeeRatio"></label>
                            </div>
                        </div>
                        <div id="depositType" class="form-group depositType">
                            <label class="wd125 control-label"> 存款等级：</label>
                            <div class="input-group wd300">
                                <input type="checkbox" class="no-color" name="deposit" value="A" disabled />A
                                <input type="checkbox" class="no-color" name="deposit" value="B" disabled />B
                                <input type="checkbox" class="no-color" name="deposit" value="C" disabled />C
                                <input type="checkbox" class="no-color" name="deposit" value="D" disabled />D
                                <input type="checkbox" class="no-color" name="deposit" value="E" disabled />E
                                <input type="checkbox" class="no-color" name="deposit" value="F" disabled />F
                                <input type="checkbox" class="no-color" name="deposit" value="G" disabled />G
                                <input type="checkbox" class="no-color" name="deposit" value="H" disabled />H
                                <input type="checkbox" class="no-color" name="deposit" value="I" disabled />I
                            </div>
                        </div>
                        <div class="form-group crossBankPay" id="divCrossBankPay">
                            <label class="wd125 control-label"> 跨行转账：</label>
                            <label class="wd125 control-label margin-font" id="crossBankPay"></label>
                        </div>
                        <!--付款卡end-->
                        <!--中转卡(中转费率)-->
                        <div id="divTransportRate" class="form-group transportRate">
                            <label class="wd125 control-label">中转费率(%)：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="transportRate"></label>
                            </div>
                        </div>
                        <!--中转卡end-->
                        <!--收款卡(收款费率)-->
                        <div class="form-group depositFeeRatio" id="divDepositFeeRatio">
                            <label class="wd125 control-label"> 收款费率(%)：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="depositFeeRatio"></label>
                            </div>
                        </div>
                        <!--收款卡end-->
                        <div class="form-group">
                            <label class="wd125 control-label">网盾类型：</label>
                            <label class="wd125 control-label margin-font" id="usbType"></label>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">开户地：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font margin-font" id="accountBank"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">证件号码：</label>
                            <div class="input-group wd250">
                                <label class="wd125 control-label margin-font" id="documentNumber"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">手机号码：</label>
                            <div class="input-group wd250">
                                <label class="wd125 control-label margin-font" id="phoneNumber"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">机器位置：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="ipAddress"></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="wd125 control-label">备注：</label>
                            <div class="">
                                <label class="wd125 control-label margin-font" id="remark"></label>
                            </div>
                        </div>
                    </div>

                    <div class="tab-pane fade" id="ext">
                        <div class="form-group limitDepositAmount">
                            <label class="wd125 control-label">限制收款金额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="limitDepositAmount" placeholder="不限制，请配置 0 " maxlength="16" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group limitDepositCount">
                            <label class="wd125 control-label">限制收款笔数：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="limitDepositCount" placeholder="不限制，请配置 0 " maxlength="16" autocomplete="off" value="0">
                            </div>
                        </div>

                        <div class="form-group limitPayAmount">
                            <label class="wd125 control-label">限制付款金额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="limitPayAmount" placeholder="不限制，请配置 0 " maxlength="16" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group limitPayCount">
                            <label class="wd125 control-label">限制付款笔数：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="limitPayCount" placeholder="不限制，请配置 0 " maxlength="16" autocomplete="off" value="0">
                            </div>
                        </div>

                        <div class="form-group limitStatus">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>状态：</label>
                            <div class="wd250 m15_l">
                                <label class="m10_r">
                                    <input type="radio" name="limitStatus" value="1"> 启用
                                </label>
                                <label>
                                    <input type="radio" name="limitStatus" value="2"> 禁用
                                </label>
                            </div>
                        </div>
                        <div class="form-group limitPayCount">
                            <label class="wd125 control-label"></label>
                            <div class="">
                            </div>
                        </div>
                        <div class="form-group limitPayCount">
                            <label class="wd125 control-label"></label>
                            <div class="">
                            </div>
                        </div>
                    </div>

                    <div class="tab-pane fade" id="transportCard">
                        <div class="form-group transferMethod">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>是否显示存款卡中：</label>
                            <div class="wd250 m15_l">
                                <label class="m10_r">
                                    <input type="radio" name="showedOnDepositCard" value="1"> 呈现
                                </label>
                                <label class="m5_t">
                                    <input type="radio" name="showedOnDepositCard" value="2"> 不呈现
                                </label>
                            </div>
                        </div>
                        <div class="form-group triggeredAmount">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>触发中转金额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="triggeredAmount" placeholder="触发中转金额，默认5000 " maxlength="10" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group transferredAmount">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>每次中转金额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="transferredAmount" placeholder="每次中转金额，不限制请配置 0 " maxlength="10" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group preservedBalance">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>预留账户金额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="preservedBalance" placeholder="预留账户金额，默认25 " maxlength="10" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group transferMethod">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>中转方式：</label>
                            <div class="wd250 m15_l">
                                <label class="m10_r">
                                    <input type="radio" name="transferMethod" value="1"> 自动
                                </label>
                                <label>
                                    <input type="radio" name="transferMethod" value="2"> 指定转入卡
                                </label>
                            </div>
                        </div>
                        <div class="form-group destinationBCID">
                            <div class="data-view m50_l" style="overflow-x:hidden; width:80%">
                                <table class="table table-striped table-bordered transportCardRule">
                                    <thead>
                                        <tr>
                                            <th class="t_l wd120">转入卡</th>
                                            <th class="t_l wd100">限定金额</th>
                                            <th class="t_c wd50">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-group destinationOrderSideBalance">
                            <label class="wd125 control-label"><span class="WdateFmtErr">*</span>转入卡余额：</label>
                            <div class="">
                                <input class="form-control wd250" type="text" name="destinationOrderSideBalance" placeholder="转入卡余额，默认 30000" maxlength="10" autocomplete="off" value="0">
                            </div>
                        </div>
                        <div class="form-group destinationCardType">
                            <label class="wd125 control-label">转入卡类型：</label>
                            <div class="">
                                <select class="input-group wd250" name="destinationCardType" maxlength="40" autocomplete="off" multiple="multiple">
                                    <option value="">请选择</option>
                                    <option value="1">收款卡</option>
                                    <option value="2">中转卡</option>
                                    <option value="3">付款卡</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group destinationBankCode">
                            <label class="wd125 control-label">转入卡银行：</label>
                            <div class="">
                                <select class="input-group wd250" name="destinationBankCodes" maxlength="40" autocomplete="off" multiple="multiple"></select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </section>
    <script type="text/javascript">
        var ShowDetailInfo = function () {
            var self = this;
            self.obj = {
                cardType: "#cardType",      //银行卡类型
                paymentTypeName: "#paymentTypeName",
                companyName: "#companyName",
                bankName: "#bankName",
                orderNo: "#orderNo",
                cardNumber: "#cardNumber",//银行卡号
                secCardNumber: "#secCardNumber",//副卡号
                usingStatus: "#usingStatus",//银行卡使用状态
                enableStatus: "#enableStatus",//银行卡启用状态
                loginName: "#loginName", //登陆名称
                passwordLogin:"#passwordLogin",//登陆密码
                passwordQuery:"#passwordQuery",//查询密码
                passwordPay:"#passwordPay",//支付密码
                passwordShield:"#passwordShield",//网盾密码

                transportRate: "#transportRate",//中转费率
                depositFeeRatio: "#depositFeeRatio",//收款费率

                paymentStart: "#paymentStart",
                paymentEnd: "#paymentEnd",
                payFeeRatio: "#payFeeRatio",//付款费率
                crossBankPay: "#crossBankPay",//跨行转账

                usbType: "#usbType",//网盾类型
                accountBank: "#accountBank",//开户地，
                documentNumber: "#documentNumber",//证件号码
                phoneNumber: "#phoneNumber",//手机号码
                ipAddress: "#ipAddress",//机器位置
                remark: "#remark"//备注
            }

            self.BindEvent = function (id, companyId,type) {
                var cover = FlashPay.UI.Mask({
                    obj: $("body"),
                    opacity: 0.5
                });

                FlashPay.Util.Ajax({
                    type: "POST",
                    url: "/Bank/GetBank?bcId=" + id,
                    dataType: "json",
                    contentType: "application/json",
                    success: function (res) {

                        $(self.obj.companyName).html(res.companyName);

                        if (res.bankInfoResponse != null) {
                            $.each(res.bankInfoResponse, function (i, item) {
                                if (item.bankCode == res.bankCode) {
                                    $(self.obj.bankName).html(item.bankName);//银行名称
                                    return;
                                }
                            });
                        }

                        $(self.obj.paymentTypeName).html(res.paymentTypeName);

                        $(self.obj.cardType).html(FlashPay.Util.GetCardTypeValue(res.cardType));//银行卡类型
                        $(self.obj.orderNo).html(res.orderNo);//订单号
                        $(self.obj.cardNumber).html(res.cardNumber);//银行卡号
                        $(self.obj.secCardNumber).html(res.secCardNumber);//副卡号
                        $(self.obj.usingStatus).html(FlashPay.Util.GetCardStatusValue(res.usingStatus));//使用状态
                        $(self.obj.enableStatus).html(FlashPay.Util.GetSpareCardEnableStatusValue(res.enableStatus));//启用状态

                        //if (type == 0) {
                            $(self.obj.loginName).html(res.loginName);//登陆名称
                        //} else if(type==1){
                        //    $(self.obj.loginName).html(res.cardName);//用户名
                        //}

                        $(self.obj.passwordLogin).val(res.passwordLogin);//登陆密码
                        $(self.obj.passwordQuery).val(res.passwordQuery);//查询密码
                        $(self.obj.passwordPay).val(res.passwordPay);     //支付密码
                        $(self.obj.passwordShield).val(res.passwordShield);//网盾密码

                        $(self.obj.usbType).html(res.usbType == 1 ? "手动" : "自动");//网盾类型
                        $(self.obj.accountBank).html(res.accountBank);//开户地
                        $(self.obj.documentNumber).html(res.documentNumber);//证件
                        $(self.obj.phoneNumber).html(res.phoneNumber);//手机号码
                        $(self.obj.ipAddress).html(res.ipAddress);    //机器位置
                        $(self.obj.remark).html(res.remark);          //备注

                        //存款等级
                        var depositTypeArray = res.depositType.split(',');
                        for (var i = 0; i < depositTypeArray.length; i++) {
                            $('input[name="deposit"][value="' + depositTypeArray[i] + '"]').prop('checked', true);
                        }

                        $(self.obj.payFeeRatio).html(res.payFeeRatio/100);
                        $(self.obj.paymentStart).html(res.paymentStart);
                        $(self.obj.paymentEnd).html(res.paymentEnd);

                        $(self.obj.crossBankPay).html(FlashPay.Util.GetCrossBankPayValue(res.crossBankPay));//跨行转账

                        //收款卡(费率)
                        $(self.obj.depositFeeRatio).html(res.depositFeeRatio/100);

                        //中转卡(费率)
                        $(self.obj.transportRate).html(res.transportRate/100);

                    //额外限制
                    if (res.bankCardExtraLimitResponse != null) {
                        FlashPay.Util.SetInputVal("limitDepositAmount", res.bankCardExtraLimitResponse.limitDepositAmount);
                        FlashPay.Util.SetInputVal("limitDepositCount", res.bankCardExtraLimitResponse.limitDepositCount);
                        FlashPay.Util.SetInputVal("limitPayAmount", res.bankCardExtraLimitResponse.limitPayAmount);
                        FlashPay.Util.SetInputVal("limitPayCount", res.bankCardExtraLimitResponse.limitPayCount);
                        $("input[name='limitStatus'][value='" + res.bankCardExtraLimitResponse.limitStatus + "']").attr("checked", true);
                    } else {
                        $("input[name='limitRepeat'][value='2']").attr("checked", true);
                        $("input[name='limitChangetoPay'][value='2']").attr("checked", true);
                        $("input[name='limitChangetoDeposit'][value='2']").attr("checked", true);
                        $("input[name='limitStatus'][value='2']").attr("checked", true);
                    }
                        cover.Remove();
                    }
                });
            }
        }
        $(function () {
            var id = FlashPay.Util.GetQueryString("id");
            var companyId = FlashPay.Util.GetQueryString("companyId");
            var type = FlashPay.Util.GetQueryString("type");
            new ShowDetailInfo().BindEvent(id, companyId,type);
        })

        function changeInputType(obj) {
            var that = $(obj).prev();
            if (that.attr('type') == 'text') {
                that.attr('type', 'password');
                $(obj).find("i").removeClass("glyphicon-eye-open");
                $(obj).find("i").addClass("glyphicon-eye-close");
            } else {
                that.attr('type', 'text');
                $(obj).find("i").removeClass("glyphicon-eye-close");
                $(obj).find("i").addClass("glyphicon-eye-open");
            }
        }
    </script>
</body>
</html>